Assembly: C1.LiveLinq (in C1.LiveLinq.dll)
Syntax
C# |
---|
public void BeginUpdate() |
Visual Basic |
---|
Public Sub BeginUpdate |
Remarks
This method must be followed by EndUpdate()()()().
Use this method when you already have indexes built over the IndexedCollection<(Of <(<'T>)>)> or live views based on it, and you need to re-populate this IndexedCollection<(Of <(<'T>)>)> or perform other massive changes to items of this collection. Without this method, every single change you make causes LiveLinq to perform necessary operations for maintaining your indexes and live views dependent on this collection. In case of massive changes, this can be slower than to wait until the massive changes are done and rebuild the indexes and live views.
Between BeginUpdate and EndUpdate()()()() calls, indexes, live views, bound controls and other change notification listeners are not updated, they don't receive change notifications.
When EndUpdate()()()() is called, a SourceChangeType.Modify or SourceChangeType.Reset notification is sent, depending on whether the change affected a single item or multiple items of the collection. Even when you change a single item, it may make sense to enclose your changes in BeginUpdate/EndUpdate if you change multiple properties of the item. In that case a SourceChangeType.Modify notification is sent. If more than one item was changed, a SourceChangeType.Reset notification is sent, meaning all indexes, live views and other collections dependent on this data table must be rebuilt from scratch.